#!/usr/bin/perl

BEGIN {
	push @INC,"/usr/local/cluster/lib/perl";
}

use clutils qw(get_installed_drbdsetup_version get_drbd_proc_version);

if(! -d "/sbin/cluster/drbd-bin") {
	mkdir "/sbin/cluster/drbd-bin";
}

$v=get_installed_drbdsetup_version();
exit(0) if !defined($v);
exit(0) if -x "/sbin/cluster/drbd-bin/drbdsetup-$v";
system("cp /sbin/drbdsetup /sbin/cluster/drbd-bin/drbdsetup-$v");
if(-x "/sbin/drbdmeta") {
	system("cp /sbin/drbdmeta /sbin/cluster/drbd-bin/drbdmeta-$v");
}
chmod 0555,"/sbin/cluster/drbd-bin/drbdsetup-$v";
exit(0);
